<!DOCTYPE html>
<meta charset="utf-8" />
<link rel="stylesheet" href="ace_v1.3/assets/css/ui.jqgrid.css" />


<div class="search_panel">
<form action="" method="post" onsubmit="return pageSearch(this);">
	<div style="display: block;" class="widget-body ">
		<div class="widget-main">
			<div class="rowt">
				<div class="col-sm-12">
					<div>
						<!--  
							<div class="table-from">
							<input id="userId" name="userId" class="search-input" type="text" autocomplete="off" placeholder="操作员账号 ...">
							<i class="ace-icon fa fa-search glyphicon-search"></i>
							</div>-->
						<div class="search_elm" style="margin-left: 0px">
							<label class="label_search">商户名称:</label>
							<div class="search_input">
								<input id="custName" type="text" name="custName"
									placeholder="请输入商户名称">
							</div>
						</div>
						<div class="search_elm" style="margin-left: 0px">
							<label class="label_search">商户编号:</label>
							<div class="search_input">
								<input id="custId" type="text" name="custId"
									placeholder="请输入商户编号">
							</div>
						</div>
						<div class="search_elm" style="margin-left: 0px">
							<label class="label_search">商户手机:</label>
							<div class="search_input">
								<input id="usrMobile" type="text" name="usrMobile"
									placeholder="请输入商户手机">
							</div>
						</div>
						<div class="search_elm" style="margin-left: 0px">
							<label class="label_search">银行卡号:</label>
							<div class="search_input">
								<input id="cardNo" type="text" name="cardNo"
									placeholder="请输入银行卡号">
							</div>
						</div>
						<div class="search_elm" style="margin-left: 0px;margin-right: 15px;width: 280px;">
						    <label class="label_search" for="userName">绑定时间:</label>
							<div class="input-group">
								<input type="text" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="startTime" placeholder="起始日期" />
								<span class="input-group-addon">
									<i class="fa fa-exchange"></i>
								</span>
								<input type="text" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="endTime" placeholder="结束日期" />
							</div>

							<!-- /section:plugins/date-time.datepicker -->
						</div>
					
						
						<div class="search_button">
							<button class="btn btn-small btn_search" type="submit" title="搜索" >
								搜索
							</button>
							
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</form>
</div>
	<div class="row">
		<div class="col-xs-12">
			<table id="grid-table"></table>

			<div id="grid-pager"></div>

			<div style="margin-top: 10px">
				<span id="auth_btn">
				
				
				
				</span> <span id="paging_bar" style="float: right"> </span>
			</div>

			<!-- PAGE CONTENT ENDS -->
		</div>
		<!-- /.col -->
	</div>
	<!-- /.row -->

	<!-- page specific plugin scripts -->
	<script type="text/javascript">
		var jqGrid;
		jQuery(function($) {
			var grid_selector = "#grid-table";
			var pager_selector = "#grid-pager";

			$(window).on(
					'resize.jqGrid',
					function() {
						$(grid_selector).jqGrid('setGridWidth',
								$(".page-content").width());
					})
			var parent_column = $(grid_selector).closest('[class*="col-"]');
			$(document).on(
					'settings.ace.jqGrid',
					function(ev, event_name, collapsed) {
						if (event_name === 'sidebar_collapsed'
								|| event_name === 'main_container_fixed') {
							setTimeout(function() {
								$(grid_selector).jqGrid('setGridWidth',
										parent_column.width());
							}, 0);
						}
					})
			jQuery(grid_selector).jqGrid({
				url : "mpomng/custBankInfTempManage/query.do",
				datatype : "json",
				height : '100%',
				width : '100%',
				colNames : [ '商户编号','商户名称','商户类型','商户手机号', '银行卡号','发卡行名称','支行名称','联行号','银行卡类型', '卡片状态','绑定时间','操作' ],
				colModel : [ {name : 'custId',     index : 'custId',     width : '120px' }, 
				             {name : 'custName',     index : 'custName',     width : '100px' }, 
				             {name : 'custType',     index : 'custType',     width : '80px',ditcKey:'CUSTTYPE', formatter : gridFormatByDict }, 
				             {name : 'usrMobile',     index : 'usrMobile',     width : '100px' }, 
				             {name : 'cardNo',       index : 'cardNo',       width : '150px' }, 
				             {name : 'issnam',   index : 'issnam',   width : '100px' }, 
				             {name : 'subBranck',   index : 'subBranck',   width : '250px' }, 
				             {name : 'cnapsCode',   index : 'cnapsCode',   width : '120px' }, 
				             {name : 'cardType',     index : 'cardType',     width : '100px' , ditcKey:'UNIONFIT_DCFLAG', formatter : gridFormatByDict},
				             {name : 'cardState',    index : 'cardState',    width : '100px' , ditcKey:'CARDSTATUS', formatter : gridFormatByDict}, 
				             {name : 'bindingTime',  index : 'bindingTime',   width : '130px',formatter : gridFormatByDate}, 
				             {name : 'op',  index : 'op',  width : '100px' ,formatter:operateEdit}
				            ],
				viewrecords : true,
				rowNum : 10,
				rowList : [ 10, 20, 30 ],
				altRows : true,

				shrinkToFit : false,
				multiselect : true,//设置行可多选的 
				multiboxonly : true,//

				loadComplete : function() {
					var table = this;
					setTimeout(function() {
						//加载分页
						initPagingBar(grid_selector);
					}, 0);
				},
				beforeRequest : function() {//请求之前执行
					jqGrid = this;
				},
			});
			$(window).triggerHandler('resize.jqGrid');

			$(document).one('ajaxloadstart.page', function(e) {
				$(grid_selector).jqGrid('GridUnload');
				$('.ui-jqdialog').remove();
			});

			function operateEdit(cellvalue, options, rowObject){// "<div class='hidden-phone visible-desktop btn-group'>"
				var button = "<div class=\"hidden-sm hidden-xs btn-group\">";  //定义button
					button += "<button class='btn btn-xs btn-warning' onclick='selectCustBank(\""+rowObject["bankCardId"]+"\")'" 
					+"title='详细信息查看'>审核</button>";
				return button;
			}
			//格式化日期
			function dateFormat(cellvalue, options, rowObject){
				return getDateFormat(rowObject["bindingTime"]);
			}
		});

		function selectCustBank(bankCardId) {
			if(bankCardId.length<=0){
				msg.alert("警告", "当前没有选择数据项！", "error");
				return;
			}
			var scrWidth = document.body.scrollWidth;
			openDialog({
				dialogId : 'dlg-agentEdit',
				title : '银行卡信息修改审核详情',
				pageUrl :'mpomng/custBankInfTempManage/view.do',
				dataUrl : 'mpomng/custBankInfTempManage/queryById.do',
				width : '80%',
				height:'80%',
				dataParam : {
					bankCardId : bankCardId
				},
				dataName : 'obj,map'//表单数据存储对象名称

			});
		}
		
	
	</script>